package com.emeory.m3u8;

import com.emeory.m3u8.core.DefaultVideoFilter;
import com.emeory.m3u8.core.M3u8VideoDownload;

public class Main {

  public static void main(String[] args) throws Exception{
    //存储路径
    String windowsFilePath = "D:/download/video/";
    String linuxFilePath = "/home/user/download/video/";
    //视频链接
    String videoUrl = "http://test.com/test.m3u8";
    //文件名称
    String fileName = "test.mp4";
    //创建下载实例，设置并发线程数
    M3u8VideoDownload videoDownload = new M3u8VideoDownload(10);
    //设置下载后的文件存储路径
    videoDownload.setFilePath(windowsFilePath);
    //设置视频过滤器，当下载链接包含多个视频文件时，由用户指定选择哪个视频文件，可以不设置
    videoDownload.setVideoListFilter(new DefaultVideoFilter());
    //开始下载
    videoDownload.startDownload(videoUrl, fileName);
  }
}
